home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SAVESCRN.SWG / 0006_SAVE6.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  47 lines

  1. {
  2. > I need to be able to create a screen then load it into Video Memory.
  3. > Then load it on to the screen... Does anyone have any routines to do
  4. > this??? Thanks...
  5.  
  6.       Try the following codes
  7. }
  8. Program VidRAMStuff;
  9. Uses
  10.   Crt;
  11. Const
  12.   ScreenHeight = 25;
  13.   ScreenWidth = 80;
  14. Type
  15.   OneChar = Record
  16.     Character : Char;
  17.     Attribute : Byte;
  18.     end;
  19.   RAMBuffer = Array [1..ScreenHeight, 1..ScreenWidth] of OneChar;
  20.   RAMBufPtr = ^RAMBuffer;
  21. Var
  22.   RowLoop, ColLoop : Byte;
  23.   DataFile : Text;
  24.   VideoRAM : RAMBufPtr;
  25.  
  26. begin
  27.   If (LastMode = 7) { means that the system is monochrome }
  28.     Then
  29.       VideoRAM := Ptr ($B000, $0000) { Segment:Offset address }
  30.     Else
  31.       VideoRAM := Ptr ($B800, $0000);
  32.   Assign (DataFile, 'TESTING.TXT');
  33.   ReWrite (DataFile);
  34.   For RowLoop := 1 to ScreenHeight Do
  35.     begin
  36.       For ColLoop := 1 to ScreenWidth Do
  37.         Write (DataFile, VideoRAM^ [RowLoop, ColLoop].Character);
  38.       WriteLn (DataFile);
  39.     end;
  40.   Close (DataFile);
  41.   {************************ File Saved *****************************}
  42.   {* Just add your own code to read in the data File and loaded it *}
  43.   {* back to the screen and you're all set!                        *}
  44.   {*****************************************************************}
  45. end.
  46.  
  47.